From: Georges Basile Stavracas Neto Date: Thu, 9 Jun 2022 18:40:21 +0000 (-0300) Subject: iconGrid: Always call findBestModeForSize() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~71 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b115e07b4a73fe6f3435b239fd0d1e5e1aac4026;p=gnome-shell.git iconGrid: Always call findBestModeForSize() The API surface of IconGrid was originally meant to be only setGridModes(), however findBestModeForSize() ended up being called by AppDisplay code. Now that FolderGrid sets the modes correctly, we don't need to skip calling findBestModeForSize() anymore. Always call findBestModeForSize() during IconGrid's allocation. Add an underscore to findBestModeForSize() since it's now back to be a private method of IconGrid. Part-of: --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index a5f86fc64..ac8d3ecaa 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -1180,7 +1180,7 @@ var IconGrid = GObject.registerClass({ } } - findBestModeForSize(width, height) { + _findBestModeForSize(width, height) { const { pagePadding } = this.layout_manager; width -= pagePadding.left + pagePadding.right; height -= pagePadding.top + pagePadding.bottom; @@ -1208,7 +1208,9 @@ var IconGrid = GObject.registerClass({ } vfunc_allocate(box) { - this.layout_manager.adaptToSize(...box.get_size()); + const [width, height] = box.get_size(); + this._findBestModeForSize(width, height); + this.layout_manager.adaptToSize(width, height); super.vfunc_allocate(box); }